import App from './App.vue'
import routes from './router.js'

Vue.use(VueLazyload);
Vue.use(VueRouter)
Vue.config.productionTip = false

var getImageUrl = function(url) {
  if (!url) {
    return ''
  }
  
  if (url.startsWith("//") || url.startsWith("http://") || url.startsWith("https://")) {
    return url
  }
  
  return process.env.VUE_APP_UPLOAD_URL + url
}

Object.defineProperty(Vue.prototype, 'getImageUrl', {value: getImageUrl});

const router = new VueRouter({
    mode:"history",
    routes
})

new Vue({
    router,
    render: h => h(App)
}).$mount('#app')